﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Vit.Web.Data
{
    public interface IEntityRule<T> where T : class, new()
    {
        IQueryable<T> Query(Func<T, bool> predict);
        T FirstOrDefault(Func<T, bool> predict);
        T New();
        T Insert(T obj);
        T Update(T obj);
        void Delete(T obj);
        void InsertOnSubmit(T obj);
        void UpdateOnSubmit(T obj);
        void DeleteOnSubmit(T obj);
        void SubmitChanges();
    }
}
